﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.SC.DCYY
{
    /// <summary>
    /// QingDanJiLuCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class YaChuangJianKongBiaoXueCtrl : CustomCommonTableCtrl
    {
        public YaChuangJianKongBiaoXueCtrl()
        {
            InitializeComponent();
            IniteRadioBation();
        }

        private void rq_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cuText = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                cuText.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);//2005年11月5日
            }
        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(sk_n, sk_y);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n, fmw_xx, fmw_nx);
            new RadioButtonHelper().ChangeRadioSatus(qw_n, qw_y);
            new RadioButtonHelper().ChangeRadioSatus(sk_n2, sk_y2);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n2, fmw_xx2, fmw_nx2);
            new RadioButtonHelper().ChangeRadioSatus(qw_n2, qw_y2);
            new RadioButtonHelper().ChangeRadioSatus(sk_n3, sk_y3);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n3, fmw_xx3, fmw_nx3);
            new RadioButtonHelper().ChangeRadioSatus(qw_n3, qw_y3);
            new RadioButtonHelper().ChangeRadioSatus(sk_n4, sk_y4);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n4, fmw_xx4, fmw_nx4);
            new RadioButtonHelper().ChangeRadioSatus(qw_n4, qw_y4);
            new RadioButtonHelper().ChangeRadioSatus(sk_n5, sk_y5);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n5, fmw_xx5, fmw_nx5);
            new RadioButtonHelper().ChangeRadioSatus(qw_n5, qw_y5);
            new RadioButtonHelper().ChangeRadioSatus(sk_n6, sk_y6);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n6, fmw_xx6, fmw_nx6);
            new RadioButtonHelper().ChangeRadioSatus(qw_n6, qw_y6);
            new RadioButtonHelper().ChangeRadioSatus(sk_n7, sk_y7);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n7, fmw_xx7, fmw_nx7);
            new RadioButtonHelper().ChangeRadioSatus(qw_n7, qw_y7);
            new RadioButtonHelper().ChangeRadioSatus(sk_n8, sk_y8);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n8, fmw_xx8, fmw_nx8);
            new RadioButtonHelper().ChangeRadioSatus(qw_n8, qw_y8);
            new RadioButtonHelper().ChangeRadioSatus(sk_n9, sk_y9);
            new RadioButtonHelper().ChangeRadioSatus(fmw_n9, fmw_xx9, fmw_nx9);
            new RadioButtonHelper().ChangeRadioSatus(qw_n9, qw_y9);
        }

        private void rq1_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl cuText = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                cuText.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMD_CN);//2005年11月5日
            }
        }
    }
}
